<template>
  <div class="in-wrap">
    <client-only>
    <header id="header">
      <section class="container">
        <h1 id="logo">
          <a href="/" title="三湘银行">
            <img
              src="https://www.csxbank.com/Upload/Template/yizhu/SiteConfigPhoto/Original/202008/d8afdbe4-f5e2-4897-8f00-8e7b762b7e27.png"
              width="100%"
              alt="三湘银行"
            />
          </a>
        </h1>
        <div class="h-r-nsl">
          <ul class="nav">
            <router-link to="/" tag="li" active-class="current" exact>
              <a>首页</a>
            </router-link>
            <router-link to="/product" tag="li" active-class="current">
              <a>产品</a>
            </router-link>

             <router-link to="/seckillProduct" tag="li" active-class="current">
              <a>产品秒杀</a>
            </router-link>
          </ul>
          <ul class="h-r-login">
            <li v-if="!userInfo.id" id="no-login">
              <a href="/login" title="登录">
                <em class="icon18 login-icon">&nbsp;</em>
                <span class="vam ml5">登录</span>
              </a>
              |
              <a href="/register" title="注册">
                <span class="vam ml5">注册</span>
              </a>
            </li>
            <li v-if="userInfo.id" id="is-login-one" class="mr10">
              <a id="headerMsgCountId" href="#" title="消息">
                <em class="icon18 news-icon">&nbsp;</em>
              </a>
              <q class="red-point" style="display: none">&nbsp;</q>
            </li>
            <li v-if="userInfo.id" id="is-login-two" class="h-r-user">
              <a href="/user" title>
                <img
                  src="https://mall-ts.oss-cn-shanghai.aliyuncs.com/mrtx.jfif"
                  width="30"
                  height="30"
                  class="vam picImg"
                  alt
                />
                <span id="userName" @click="userGoInfo()" class="vam disIb">{{ userInfo.name }}</span>
              </a>
              <a
                href="javascript:void(0);"
                title="退出"
                @click="logout()"
                class="ml5"
                >退出</a
              >
            </li>

          </ul>

        </div>
        <aside class="mw-nav-btn">
          <div class="mw-nav-icon"></div>
        </aside>
        <div class="clear"></div>
      </section>
    </header>

    <nuxt />


    <footer id="footer" >
      <section class="container">

        <div class="b-foot">
          <section class="fl col-7">
            <section class="mr20">
              <section class="b-f-link">
                <a href="https://www.csxbank.com/gysx.html" title="关于我们" target="_blank">关于我们</a>|
                <a href="https://www.csxbank.com/fzlc.html" title="发展历程" target="_blank">联系我们</a>|
                <a href="https://www.csxbank.com/sxry.html" title="三湘荣誉" target="_blank">帮助中心</a>|
                <a href="https://www.csxbank.com/sxdt.html" title="资源下载" target="_blank">三湘动态</a>|
                <span>服务热线：0731-96500</span>
                <span>Email：kfbos@csxbank.com</span>
              </section>
              <section class="b-f-link mt10">
                <span>2022 © Copyright 湖南三湘银行股份有限公司</span>
              </section>
            </section>
          </section>
          <aside class="fl col-3 tac mt15">
            <section class="gf-tx">
              <span>
                <img src="~/assets/img/wx-icon.png" alt />
              </span>
            </section>
            <section class="gf-tx">
              <span>
                <img src="~/assets/img/wb-icon.png" alt />
              </span>
            </section>
          </aside>
          <div class="clear"></div>
        </div>
      </section>
    </footer>
    </client-only>
  </div>
</template>
<script>
import '~/assets/css/reset.css'
import '~/assets/css/theme.css'
import '~/assets/css/global.css'
import '~/assets/css/web.css'
import '~/assets/css/base.css'
import '~/assets/css/activity_tab.css'
import '~/assets/css/bottom_rec.css'
import '~/assets/css/order.css'

import cookie from "js-cookie";

export default {
  data() {
    return {
      userInfo: {
        id: "",
        name: "",
        gender: "",
        telphone: "",
      },
    };
  },
  created() {
    this.show();
  },

  methods: {
    show() {
      var jsonStr = cookie.get("userInfo");
      if (jsonStr) {
        undefined;
        this.userInfo = JSON.parse(jsonStr);
      }
    },
    logout() {
      cookie.set("userInfo", "");
      cookie.set("token", "");
      window.location.href = "/";
    },
    userGoInfo(){
       this.$router.push({path: '/user'})
    }
  },
};
</script>
